/* 修改:root变量 */
:root {
    --primary-color: #1890ff;
    --primary-hover: #40a9ff;
    --primary-active: #096dd9;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --error-color: #f5222d;
    --text-primary: rgba(0, 0, 0, 0.85);
    --text-secondary: rgba(0, 0, 0, 0.65);
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
}

/* 增强导航栏 */
.header {
    background-color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-menu a {
    color: #666;
    text-decoration: none;
    font-size: 16px;
    padding: 8px 0;
    position: relative;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-menu a.active {
    color: var(--primary-color);
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

/* 优化卡片阴影 */
.card {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
}

/* 按钮动效 */
.btn-primary {
    box-shadow: 0 2px 4px rgba(24, 144, 255, 0.3);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(24, 144, 255, 0.3);
}

/* 表单聚焦状态 */
.form-input:focus {
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.15);
}

/* 全局样式 */
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    background-color: #f0f2f5;
}

/* 布局 */
.container {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 20px;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 24px;
    margin-bottom: 24px;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #40a9ff;
}

.btn-error {
    background-color: var(--error-color);
    color: white;
}

.btn-error:hover {
    background-color: #ff4d4f;
}

/* 表单样式 */
.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(24,144,255,0.2);
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.table th {
    background-color: #fafafa;
    font-weight: 500;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 其他通用样式 */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* 问卷任务页面样式 */
.task-info {
    padding: var(--space-md);
    background: #f8f9fa;
    border-radius: 4px;
}

.status-row {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.status-label {
    width: 120px;
    color: var(--text-secondary);
}

.status-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    color: white;
}

.status-badge.running {
    background-color: var(--success-color);
    animation: pulse 1.5s infinite;
}

.action-row {
    margin-top: var(--space-md);
    display: flex;
    gap: var(--space-sm);
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

/* 问卷解析相关样式 */
.url-input-group {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.parse-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
}

.questionnaire-info {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.questionnaire-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

.questionnaire-desc {
    color: var(--text-secondary);
    font-size: 14px;
}

.questions-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.question-item {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.question-header {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.question-type {
    font-size: 12px;
    padding: 2px 8px;
    background: var(--primary-color);
    color: white;
    border-radius: 12px;
}

.question-required {
    font-size: 12px;
    padding: 2px 8px;
    background: var(--warning-color);
    color: white;
    border-radius: 12px;
}

.question-title {
    font-weight: 500;
    margin-bottom: var(--space-md);
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.option-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.answer-select {
    width: auto;
    min-width: 120px;
}

.option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 12px 15px;
    border-radius: 6px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.option-row:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.option-text {
    flex: 1;
    margin-right: 20px;
    font-size: 14px;
    color: #495057;
}

.option-percentage {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 4px;
    padding: 4px 8px;
    border: 1px solid #ced4da;
    min-width: 80px;
}

.percentage-input {
    width: 40px;
    text-align: right;
    border: none;
    padding: 0;
    margin-right: 0;
    font-size: 14px;
    color: #495057;
    background: transparent;
    -moz-appearance: textfield;
}

.percentage-input::-webkit-outer-spin-button,
.percentage-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.percentage-input:focus {
    outline: none;
}

.percentage-symbol {
    color: #495057;
    font-size: 14px;
    margin-left: 2px;
}

.percentage-total {
    margin-top: 15px;
    padding: 10px 15px;
    background-color: #e9ecef;
    border-radius: 6px;
    text-align: right;
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

.text-answers {
    margin-top: 15px;
}

.text-answers-header {
    margin-bottom: 15px;
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

.text-answer-item {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: flex-start;
}

.text-answer {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
    transition: all 0.2s ease;
}

.text-answer::placeholder {
    color: #adb5bd;
}

.text-answer:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
    outline: none;
}

.text-answers .btn-small {
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 4px;
}

.text-answers .add-answer {
    margin-top: 8px;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    color: #495057;
}

.text-answers .add-answer:hover {
    background-color: #dee2e6;
}

.text-answers .remove-answer {
    padding: 6px 10px;
    background-color: #dc3545;
    border: none;
    color: white;
}

.text-answers .remove-answer:hover {
    background-color: #c82333;
}

.question-type {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    background-color: #e9ecef;
    color: #495057;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 15px;
}

.question-title {
    font-size: 16px;
    font-weight: 500;
    color: #212529;
    margin-bottom: 20px;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .nav {
        flex-direction: column;
        height: auto;
        padding: 10px 0;
    }

    .nav-menu {
        margin: 10px 0;
    }

    .modal-content {
        min-width: 300px;
        margin: 0 10px;
    }
}